<?php
namespace Shopadmin\Controller;
use Think\Controller;
class ApiController extends ExtendController {
	public function get_prom(){
		Vendor('taobaosdk.top.request.VasSubscribeGetRequest');
		// echo $this->usernick;
		$req = new \VasSubscribeGetRequest;
		$req->setNick($this->usernick);
		$req->setArticleCode("FW_GOODS-1840332");
		$resp = $this->c->execute($req);
		if(!($resp->article_user_subscribes->article_user_subscribe[0]->item_code)){
			$r["status"]="notbuy";
			$this->ajaxReturn($r);
			die();
		}
		if((strtotime($resp->article_user_subscribes->article_user_subscribe[0]->deadline)<time())){
			$r["status"]="timeout";
			$this->ajaxReturn($r);
			die();
		}
		$r = $fetchService->fetchByGet("http://hg.itianshan.com/?m=Shopmodule&a=loadprom&shopid=".$this->sid."&usernick=".$this->usernick);
		$this->ajaxReturn(json_decode(urldecode_utf8($r)));
	}
	public function send_prom(){
		
	}
}